<?php use_helper("SWFUpload", "Javascript"); ?>

<?php echo swf_upload_javascript("sfSWFUpload/upload",array("PHPSESSID" => "NONE"), array()); ?>

<div style="margin:20px; float: left; width: 400px;" > 

<?php echo swf_upload_standard_html(); ?>



<?php echo javascript_tag(
"function queueComplete() {
  new Ajax.Updater('preview', '".url_for('sfSWFUpload/showUploads')."', {asynchronous:true, evalScripts:false});
}"
) ?> 


<?php echo javascript_tag(
"
// redefining fileQueued
function fileQueued(file) {
	try {
		var progress = new FileProgress(file, this.customSettings.progressTarget);
		progress.setStatus('Pending...         file size: ' + size_format(file.size));
		progress.toggleCancel(true, this);

	} catch (ex) {
		this.debug(ex);
	}
}

function uploadSuccess(file, serverData) {
	try {
		var progress = new FileProgress(file, this.customSettings.progressTarget);
		progress.setComplete();
		progress.setStatus('Complete.');
		progress.toggleCancel(false);

	} catch (ex) {
		this.debug(ex);
	}
}


function fileDialogComplete(numFilesSelected, numFilesQueued) {
	try {
		if (numFilesSelected > 0) {
			document.getElementById(this.customSettings.cancelButtonId).disabled = false;
		}
		
		
	} catch (ex)  {
        this.debug(ex);
	}
}

function submitUpload() { 
	swfu.startUpload();
}

"
) ?> 


</div>


<div id="preview2" style="float: left; width: 30%; margin: 20px;">

</div>
<div id="preview" style="float: left; width: 30%; margin: 20px;">
<?php include_partial('sfSWFUpload/simple_list_fotos', array('photos' => $photos, 'small_gallery_dir' => $small_gallery_dir )) ?>
</div>

